package com.nowcoder.community.dao;

import com.nowcoder.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentMapper {
    // 分页查询
    List<Comment> selectCommentsByEntity(
            @Param("entityType") int entityType,@Param("entityId") int entityId,
            @Param("offset") int offset,@Param("limit")int limit);

    // 查询评论总数
    int selectCountByEntity(@Param("entityType") int entryType, @Param("entityId") int entryId);

    int insertComment(Comment comment);

    Comment selectCountById(int id);

}
